#include<bits/stdc++.h>

using namespace std;
int main()
{
	int x  = 0, y = 0;
	while (cin >> x >> y) {
		int  odd = 0;
		int  even = 0;
		if (x > y) {//注意 x>y
			swap(x, y);
		}
		for (int i = x; i <= y; i++) {
			if (i % 2 == 1) {
				odd += i * i * i;
			} else {
				even += i * i;
			}

		}
		cout << even  << " " <<  odd << endl;
	}
	return 0;
}
